package com.Lixiaoqian.Gulangyu.base

import android.app.Application
import android.content.Context
import com.Lixiaoqian.Gulangyu.location.PositionBean
import com.Lixiaoqian.Gulangyu.utils.SPUtil
import com.Lixiaoqian.Gulangyu.utils.ToastUtils
import com.baidu.mapapi.SDKInitializer
import com.tencent.bugly.Bugly
import skin.support.SkinCompatManager
import skin.support.constraint.app.SkinConstraintViewInflater
import skin.support.design.app.SkinMaterialViewInflater



/**
 * Created by huangzhibo on 2018-02-26.
 * mail:1043202454@qq.com
 */
class QianTechApp:Application() {
    lateinit var currentPosition:PositionBean
    override fun onCreate() {
        super.onCreate()
        initSdk()
    }
    companion object {
        lateinit var context: Context
    }
    private fun initSdk() {
        context=this@QianTechApp
        //bugly
        Bugly.init(applicationContext, "c156fa466a", true)
        //skin
        SkinCompatManager.withoutActivity(this)
                .addInflater(SkinMaterialViewInflater())
                .addInflater(SkinConstraintViewInflater())
                .loadSkin()
        //百度
        SDKInitializer.initialize(this)
        SPUtil.init(this,"qiantech_pre")
        ToastUtils.setContext(this)
    }
}